package com.ht.domin.bo;

import com.ht.dto.ArticleDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * 科普号推荐实体类（文章）
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
//数据库中对应的数据库名
@Document(collection = "article")
public class ArticleBO {

    @Id
    @Field("_id")
    private String id;
    //医生
    private String doctor;
    //职位
    private String level;
    //所属医院
    private String hospital;
    //所属科室
    private String department;
    //文章发表时间
    @Field("published_time")
    private String publishedTime;
    //文章标题
    @Field("article_title")
    private String articleTitle;
    //文章内容
    private String article;
    //科普文章审核状态
    @Field("article_status")
    private String articleStatus;
    //科普文章类型
    @Field("article_type")
    private String articleType;
    //对应的知识id
    @Field("knowledge_id")
    private String knowledgeId;

    public ArticleBO(ArticleDTO dto){
        this.id = dto.getId();
        this.doctor = dto.getDoctor();
        this.level = dto.getLevel();
        this.hospital = dto.getHospital();
        this.department = dto.getDepartment();
        this.publishedTime = dto.getPublishedTime();
        this.articleTitle = dto.getArticleTitle();
        this.article = dto.getArticle();
        this.articleStatus = dto.getArticleStatus();
        this.articleType = dto.getArticleType();
        this.knowledgeId = dto.getKnowledgeId();
    }

}
